#include "snake_cell.h"

void SnakeCell::draw(SDL_Renderer* renderer, SDL_FRect* range, ResourceManager& resManager)
{
    if (is_head)
    {
        SDL_FPoint center = {range->w / 2, range->h / 2};
        // SDL_RenderTexture(renderer, resManager.getTexture("snake-head.bmp"), nullptr, range);
        SDL_RenderTextureRotated(renderer, resManager.getTexture("snake-head.bmp"), NULL,
        range, direction.rotate, &center, SDL_FLIP_NONE);
        // SDL_SetRenderDrawColor(renderer, 255, 255, 0, SDL_ALPHA_OPAQUE);
    } else 
    {
        SDL_SetRenderDrawColor(renderer, 0, 128, 0, SDL_ALPHA_OPAQUE);
        SDL_RenderFillRect(renderer, range);
    }
}